home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Commodities / BlocNotes / SendMail.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  858b  |  38 lines

  1. /*Simple script to Send a note as a mail*/
  2.  
  3. address 'blocnotes.rexx'
  4. options results
  5.  
  6. /*********************ATTENTION**********************/
  7. /* MUST be definded envinronment variable SENDMAIL  */
  8. /****************************************************/
  9.  
  10. SENDMAIL=getvar('SENDMAIL')
  11.  
  12. /****************************************************/
  13.  
  14. /*Get the id of the note*/
  15.  
  16. parse arg id .
  17.  
  18. ISANOTE id
  19. if RESULT=1 then do     /* Check if the id is valid*/
  20.    GETLINE id 0
  21.    ln=RESULT
  22.    if pos('To:',ln)>0 then do
  23.       export id 'T:msg'||id
  24.       address command SENDMAIL||' T:msg'||id||' >t:ret'
  25.       address command 'requestchoice TITLE Mail GADGETS Ok BODY "`type t:ret`"'
  26.       address command 'delete T:msg'||id
  27.       address command 'delete T:ret'
  28.    end
  29. end
  30.  
  31. exit
  32.  
  33. getvar:
  34. filename='ENV:'||arg(1)
  35. call open('var',filename)
  36. string=readln('var')
  37. return string
  38.